from datetime import datetime, timedelta


def nowData(year:int = 0,month:int = 0,day:int = 0,hour:int = 0):
    # 获取当前日期和时间
    newData = datetime.now()
    if year !=0:
        newData = newData.replace(year=newData.year + year)
    if month !=0:
        newData = newData.replace(month=newData.month + month)
    if day != 0:
        newData = newData.replace(day=newData.day + day)
    if hour != 0:
        newData = newData.replace(hour=newData.hour + hour)
    # 格式化日期和时间
    formatted_datetime = newData.strftime("%Y-%m-%d %H:%M:%S")
    return formatted_datetime

def nowDay(year:int = 0,month:int = 0,day:int = 0,hour:int = 0):
    # 获取当前日期和时间
    newData = datetime.now()
    if year !=0:
        newData = newData.replace(year=newData.year + year)
    if month !=0:
        newData = newData.replace(month=newData.month + month)
    if day != 0:
        newData = newData.replace(day=newData.day + day)
    # 格式化日期和时间
    formatted_datetime = newData.strftime("%Y-%m-%d")
    return formatted_datetime

# aa = nowDay()
# print(aa)